#!/bin/bash
echo "build aqie success"

pid=`ps -ef | grep hospital-register-1.0.0.jar | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
   kill -9 $pid
fi

pid=`ps -ef | grep hospital-upms-biz-1.0.0.jar | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
   kill -9 $pid
fi

pid=`ps -ef | grep hospital-auth-1.0.0.jar | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
   kill -9 $pid
fi

pid=`ps -ef | grep hospital-gateway-1.0.0.jar | grep -v grep | awk '{print $2}'`
if [ -n "$pid" ]
then
   kill -9 $pid
fi




# register
cd /home/pixiao/.m2/repository/com/wyzy/hospital-register/1.0.0
BUILD_ID=dontKillMe nohup java -jar hospital-register-1.0.0.jar &
sleep 10

#  admin
cd /home/pixiao/.m2/repository/com/wyzy/hospital-upms-biz/1.0.0
BUILD_ID=dontKillMe nohup java -jar hospital-upms-biz-1.0.0.jar &
sleep 10

# auth
cd /home/pixiao/.m2/repository/com/wyzy/hospital-auth/1.0.0
BUILD_ID=dontKillMe nohup java -jar hospital-auth-1.0.0.jar &
sleep 10

# gateway
cd /home/pixiao/.m2/repository/com/wyzy/hospital-gateway/1.0.0
BUILD_ID=dontKillMe nohup java -jar hospital-gateway-1.0.0.jar &
sleep 10